package com.study.scapp.info.common;

import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * Keafmd
 *
 * @ClassName: LocalDateTimeConverter
 * @Description: 日期处理
 */

@Component
public class LocalDateTimeConverter implements Converter<String, LocalDateTime> {
    //2021-04-29%2001:02:03
    @Override
    public LocalDateTime convert(String s) {
        return LocalDateTime.parse(s, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
    }
}
